#!/bin/bash
# 作者：aif
# 时间：2018-01-27
# 说明：安装openresty
# 安装步骤
# 安装依赖
# 配置openresty yum源
# 安装openresty
# 安装luagit

# 变量
LOG_PATH='./install.log'

source /etc/rc.d/init.d/functions
source ./common/common_func.sh

# 安装依赖
REVALUE=0
function installdepends(){
	yum  -y   install pcre-devel openssl-devel gcc curl yum-utils >> ${LOG_PATH}
	# 日志输出到日记文件中
	REVALUE=$?
	[[ ${REVALUE} == 0 ]] && action "安装依赖成功" /bin/true || action "安装依赖" /bin/false
	exitShell ${REVALUE}

# 配置openresty yum源
function openrestyyum(){
	yum-config-manager –add-repo https://openresty.org/yum/cn/centos/OpenResty.repo >> ${LOG_PATH}
}


# 安装openresty
function installopenresty(){
	yum -y install openresty >> ${LOG_PATH}
}

# 卸载openresty
function uninstallopenresty(){
	yum -y autoremove openresty >> ${LOG_PATH}
}